home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / util / conv / Wav2Cas.lha / Wav2Cas.txt < prev    next >
Encoding:
Text File  |  2002-02-18  |  81.6 KB  |  1,238 lines

  1. Atari classic tape recovery program.  Version May 1997.
  2.  
  3. Preface.
  4.  
  5. I have always had a strong resentment towards saving data onto cassette
  6. tape.  This is probably due to the fact that it is sometimes a write only
  7. medium.  Data that is stored on a cassette tape is sometimes impossible to
  8. ever load again.  I have had this problem ever since our first computer,
  9. which was a system based on the S-100 bus.  It had an 8080 processor, and a
  10. cassette interface.  When I finally went out and bought a real nice
  11. computer, it was time to buy the Atari 800 system.  I knew right away that
  12. I wanted an 810 diskette drive.  I thought it would be nice to be able to
  13. load games from cassette too, so I did buy a 410 cassette recorder as well.
  14. When I got home from the store, it turned out that my 810 was not
  15. operational, and thus I was forced to use the 410 for a couple of days.  I
  16. soon found out that the cassette system on the Atari was not much better
  17. than that on our old S-100 bus system.  I rushed back to the store to get
  18. the 810 replaced.  Ever since that first day, I have never trusted a
  19. cassette unit again.  Various models were introduced to replace the old
  20. 410.  The 1010 appeared, followed by the XC11 and the XC12.  Some units
  21. worked better than others.  Some had severe problems with noise and hum.  I
  22. cannot begin to count the number of load errors that I have experienced.
  23. And I have had a floppy drive almost from the beginning.  I started to hold
  24. a grudge against cassette units.  Numerous times, I have dreamt about
  25. throwing one from the world trade center, or some similar building, just to
  26. see it be smashed into more pieces than are listed in the service
  27. documentation.  This is what I advised people to do when I bought a box of
  28. 1010 cassette units.  I sold them strictly for the SIO-cable, telling
  29. people that the 1010 unit came with it for free, and that it could be
  30. thrown off a tall building.  Actually, since it is illegal and dangerous to
  31. throw things off of a tall building, I had to come up with another way to
  32. pay these nasty cassette units back for all the load errors they have
  33. inflicted on me.  This project is the result of my efforts.  It is payback
  34. time, so all you 410's, 1010's, XC11's, XC12's, beware, you are about to
  35. become obsolete.
  36.  
  37. Purpose of this project.
  38.  
  39. The design goal of this project is to retrieve the data that is stored on
  40. cassette tapes.  This sounds like a sensible thing to do with a storage
  41. device.  That is, unless you design cassette interfaces.  The data can be
  42. stored on a mass storage device on some host system.  It should be possible
  43. to load the data from the host system into the Classic Atari.  The data
  44. could also be re-saved onto cassette tape, thus cleaning up faulty tapes
  45. that contain dropouts, spikes, noise, or other problems.  Data that is
  46. damaged can be restored, or repaired.  The data on the new tape could be
  47. saved at a higher baudrate, thus reducing the time required to load the
  48. tape.  The quality of the cassette tape can be greatly improved in this
  49. way.  The various emulators that currently exist, might add support for the
  50. file format used to store the cassette data.  Booting a cassette tape on
  51. these emulators could then be implemented, and it could load a tape
  52. instantly.  Since the cassette data is retrieved using only a sound card
  53. and some software, there is no need for a cassette unit.  Data can be
  54. retrieved from the cassette tapes even if your cassette unit is broken,
  55. unreliable, or otherwise not available.  Data that is retrieved from a tape
  56. can be processed, and converted to a disk format.
  57.  
  58. Theory of operation.
  59.  
  60. In order to be able to retrieve information, we must first know how data is
  61. encoded on Atari tapes.  There is some documentation on this subject in
  62. various books and documents.  I could refer you to these documents, but
  63. since I have gathered all the information for this project, I will simply
  64. list the information here.  Data is encoded on the cassette tape as a
  65. frequency shift keying audio signal, usually referred to as FSK.  For the
  66. non-technical persons, this means that an audio tone is recorded on the
  67. tape that has either one frequency, referred to as the mark tone, or
  68. another frequency, called the space tone.  Normally, the FSK-decoder within
  69. the cassette unit will determine what tone is on the tape.  Based on the
  70. frequency of the tone, the cassette unit will convert this tone to either a
  71. "1" value, or a "0" value.  This value is placed on the serial bus DATA IN
  72. line.  So that is all the cassette unit has to do.  The POKEY chip within
  73. the Atari will be programmed by the Operating System to decode the data.
  74. The data is stored on the tape as a serial stream of bits.  Each byte
  75. contains 8 bits.  Since the data is saved as a-synchroneous data, there are
  76. also startbits and stopbits.  There is one startbit, and one stopbit.  So
  77. in order to store one byte on the cassette tape, ten bits are encoded.
  78. POKEY will notice the startbit, determine the value of the 8 bits that
  79. follow the startbit, and it will use the stopbit to synchronize again, so
  80. that it will not get confused.  The value of the 8 databits will be
  81. combined to form the byte that was encoded.  The byte is stored in a
  82. buffer, and the next byte will then be decoded.  When a complete record is
  83. decoded, the O.S. will return the status of the operation.  Sometimes it
  84. will tell you that decoding was successful.  Most of the time, a boot-error
  85. or load-error is reported.  Well, actually, sometimes it works most of the
  86. time.
  87.  
  88. All this sounds fairly simple, and actually it is.  But then again, I have
  89. left out a lot.  For one thing, since this is a-synchroneous data, POKEY
  90. must determine how long a bit actually is.  If two consecutive bits have a
  91. value of "1", how will POKEY know whether this is one bit, or two bits, or
  92. more?  This is determined by the bit-rate.  This tells POKEY how many bits
  93. are encoded within one second.  The bit-rate for Atari tapes is usually 600
  94. bits per second.  Since a simple FSK encoding scheme is used, this happens
  95. to be the same as the baudrate.  So in the manuals, it says that the tapes
  96. are written at 600 baud.  You probably should not care about the
  97. difference, since who cares anyway?  Now that we know that the speed is 600
  98. bps, we know that the duration of a single bit is 1/600th of a second.
  99. POKEY can determine the level of the serial DATA IN line for that period of
  100. time, and it will know that after this period of time, the next bit will
  101. follow.  Now a tape can be stretched a little, due to wear and tear.  Also,
  102. the speed of the motor inside the cassette unit is not always the same.  So
  103. the engineers at Atari thought it would be a nice idea to compensate for
  104. this in the O.S.  A scheme for dealing with variations in tape speeds and
  105. other problems is designed into the software.  The O.S. will measure the
  106. bit-rate at the start of each block of data.  In order to be able to do
  107. this, two bytes with a fixed value are placed at the beginning of each tape
  108. block.  When the O.S. reads the beginning of a data block, it will know
  109. that these two bytes will be the first bytes to be found.  These bytes have
  110. a known value, and thus they can be used to measure the speed of the tape.
  111. Therefore, they are called the marker bytes.  The value chosen for these
  112. marker bytes is the hexadecimal number 55.  If you translate this into
  113. bits, you will find that this means the value is 01010101.  The "1" and "0"
  114. bits alternate.  This means that there is no way that two consecutive bits
  115. can have the same value.  This makes this value ideal for measuring the
  116. length of a single bit.  Once this length has been measured, it is assumed
  117. that all the other bits in this data block have the same length, since they
  118. must have been written at the same speed.  Or actually, we hope that the
  119. speed of the motor will not vary too much from the value it was when the
  120. first two bytes were read.  The engineers at Atari allowed for quite a
  121. deviation from the standard speed.  Some sources claim that the nominal
  122. speed is 600 baud, but that the actual speed can range from 318 baud to
  123. 1407 baud.  If you dive into the Operating System source listing, there is
  124. indeed a mention of these values.  There is a table that tells the O.S.
  125. what value to store in a certain POKEY register.  What people appearantly
  126. failed to notice, is that part of this table has been commented out.
  127. Either there was not sufficient space in the ROM's, or some engineer
  128. thought this range was outrageous.  The table actually ranges from 895 down
  129. to 447 baud.  My experiments showed that the highest obtainable speed is
  130. around 820 bps, which is the second value in the table, which begins with
  131. 895.  So maybe the logic for accessing this table always skips beyond the
  132. beginning.  I have not looked at that piece of code though.  The actual
  133. speed is allowed to deviate slightly from the programmed speed, so we can
  134. get away with a speed of 875 baud.  Still, 820 bps is quite a difference
  135. from 600 bps.  When you think about it, the variation in tape speed must be
  136. enormous.  You think this tolerance would guarantee that a tape can always
  137. be loaded.  But just stop and think about this.  If the tape speed would
  138. really be more than 35 percent higher than normal, not only would the
  139. baudrate be higher, but also the tone of the FSK signals would be some 35
  140. percent higher.  The space tone is supposed to be 3995 Hz.  Add 35 percent
  141. to that, and you get about 5393 Hz, which is even beyond the value of the
  142. mark tone, which is supposed to be 5327 Hz.  This clearly shows that a
  143. speed of 1047 bps would be ridiculus.  The FSK-decoder circuit in the
  144. cassette unit can never ever cope with that much difference.  Too bad some
  145. smart engineer at Atari figured this out, and decided to limit the table.
  146. Make no mistake though, even though the cassette unit hardware cannot cope
  147. with this, POKEY would have no problem at all processing these speeds, if
  148. programmed at the right baudrate.  Remember, POKEY does all serial bus I/O
  149. at 19,200 baud, and even then it can go beyond that.  So, the cassette unit
  150. can probably not go much beyond 600 bps you would say.  Well, we cannot
  151. simply increase the speed of the tape.  But we can increase the FSK
  152. encoding bit-rate, as long as we keep the frequencies of the tones within
  153. the specifications.  More about this later.
  154.  
  155. Okay, so now we now that each block starts out with two marker bytes of
  156. hex-55.  The O.S. will assume that a data block consists of 128 data bytes.
  157. This is the standard length of a cassette block of data, as supported by
  158. the O.S.  Since the block must be 128 bytes long, regardless of how many
  159. bytes are actually stored, the O.S. must have a way of knowing how many
  160. bytes of data are stored within the block.  The third byte found in the
  161. cassette block tells the O.S. how many bytes of data are valid.  It is
  162. called the control byte.  If the block is totally filled with bytes, the
  163. control byte will have a value of hex-FC.  If the block is partially
  164. filled, this byte will be hex-FA, and the 128th data byte will indicate how
  165. many of the 128 data bytes are to be considered valid data.  Since this is
  166. by definition less than 128 bytes, the 128th byte is always available for
  167. this purpose.  Most boot-tapes will always have completely filled blocks.
  168. Files saved by basic usually do not have their last block totally filled.
  169. There is also a special code for the control byte to indicate that the end
  170. of the tape file has been reached.  If the byte has the value hex-FE, this
  171. is the end of file indicator.  The data bytes will all contain hex-00 if
  172. the tape is according to the specifications from Atari.  Some boot-tapes do
  173. not have this end of file record though.
  174.  
  175. After the marker bytes, and the control byte, we will find 128 data bytes.
  176. These are very boring, because they only contain the data or the game or
  177. whatever is saved on the tape.  After these 128 data bytes, we will find
  178. one more byte.  This byte contains the checksum.  If you add all bytes,
  179. from the marker bytes, the control byte, up to the very last data byte, you
  180. will get a checksum.  This checksum must be equal to the value found in
  181. this last byte.  If the value does not match, well, we all know what
  182. happens.  You will get a boot-error, a load-error, a message stating to try
  183. the other side of the tape, or similar problems.  Note that the carry is
  184. always added too.  So if addition of a byte causes a carry, the carry is
  185. immediately added to the checksum.  Since this checksum is merely a simple
  186. sum of all bytes, which is forced not to go beyond 255, this method of
  187. detecting errors does not offer the highest reliability, but somehow, it
  188. manages to detect load-errors every once in a while.  Well, if you paid
  189. attention, you will now know that a physical tape record as found on the
  190. tape contains 132 bytes.  The logical tape record is only 128 bytes.  When
  191. you request a read from a tape, you will only get the 128 data bytes.  The
  192. extra bytes on the tape are there solely for the purpose of retrieving and
  193. checking the data.  There are some boot-tapes that do not adhere to this
  194. standard.  Usually, they have a small boot-loader program that is booted
  195. first.  Then, they take control of the cassette unit, and bypass the
  196. Operating System.  Anything goes from that point on, like making a tape
  197. block with a record length of 1024 bytes or so.  More about this later.
  198.  
  199. We now know that a tape block usually contains 132 bytes.  Since each byte
  200. has eight bits, and is encoded with a startbit and a stopbit, there are a
  201. total of 1320 bits in one tape block.  If this is encoded at 600 bps, you
  202. will need 2.2 seconds to encode one block of data.  To allow the computer
  203. some time to process the bytes once they have been received, there is a
  204. little pause before the next data block begins.  This pause is called the
  205. Inter Record Gap, or just IRG.  The O.S. has two flavours of IRG.  One is
  206. called the short IRG, and the other is the normal IRG.  They differ mainly
  207. in duration.  A normal IRG is longer than the short IRG, but I suppose
  208. everybody already figured that one out.  Which flavour of IRG is used, is
  209. selected when the cassette file is opened, with an option in the open
  210. command.  The short IRG is also called the continuous open mode, while the
  211. normal IRG is also called the start/stop open mode.  The open mode selects
  212. whether or not the motor is stopped after the record has been written to
  213. the tape.  Since the motor has to be started again when it has been
  214. stopped, the motor must be allowed some time to get up to speed again.
  215. This is why the IRG is longer when the start/stop mode is selected.  The
  216. Inter Record Gap is the gap between one record and the next.  What do we
  217. find between the end of the previous record and the start of the next?
  218. That depends on what type of tape you come accross.  Some tapes are written
  219. by companies that mass produced cassette tapes for software companies.  The
  220. way these tapes were written differs a lot from the way a regular Atari
  221. cassette recorder will record data.  One of the differences is found in the
  222. way the IRG is created.  On an Atari cassette recorder, with the start/stop
  223. open mode, the O.S. will stop the tape motor once the record has been
  224. written.  So this means that after the end of a record, there is a fraction
  225. of a second in which the tape will come to a halt.  Whatever is written on
  226. the tape at that time is hard to say.  It is a sure bet that it will be
  227. some noise, that will not look like data at all.  However, if the short IRG
  228. mode is selected, the tape motor will not be stopped.  This means that
  229. there will be no garbage after the end of the record.  Tapes that are mass
  230. produced obviously are never stopped, because they usually use the short
  231. IRG, but also since the tape was usually produced by some sort of
  232. duplication machine, not a real Atari.  The master tape was probably
  233. generated with a professional FSK modulator.  More about this later.  The
  234. stuff that we find on the tape after the end of the record, is called the
  235. Post Record Gap, or just PRG.  At the start of each record, a Pre Record
  236. Write Tone is written so that it will be easy to recognize the beginning of
  237. the record.  This is the PRWT.  If the short IRG is selected, the PRWT will
  238. last 0.25 seconds.  For a normal IRG, this PRWT will last 3 seconds.  With
  239. a normal IRG, the PRG can last up to one second.  With a short IRG, the
  240. length of the PRG can be anything.  It depends on how much time was needed
  241. for the program to start writing the next record.  If you used a simple
  242. save command to write the program or data to the tape, the PRG will be
  243. close to zero seconds, but if it is a data record written by a program, it
  244. might take several seconds.  Then again, what would be the point in using
  245. the short IRG then?  Anyway, what gets written to tape when the short IRG
  246. is in effect is usually a mark tone.  The PRG and PRWT will form the IRG
  247. together, and it is hard to tell where one ends and the other starts.
  248. Since they are the same tone, we only have to worry about what happens when
  249. the tape stops and starts again.  We will have to treat that portion of the
  250. tape as noise.
  251.  
  252. Since we are on the subject of gaps, there is a special gap at the
  253. beginning of the tape.  Well, since there is nothing before the gap, I
  254. suppose you cannot really call it a gap.  That is probably the reason why
  255. it is called the leader.  Each tape file starts out with a leader of 20
  256. seconds.  This leader will be written as a mark tone.  The leader allows us
  257. to recognize the beginning of the tape file.  Most cassette tapes have a
  258. special leader tape portion to attach the tape to the spindles.  This
  259. portion is usually made of a different material, so no data can be recorded
  260. on it.  Since data is often saved at the beginning of a tape, the leader
  261. will make sure that no data is written before the tape leader has passed
  262. by.  Since the O.S. knows that this leader must be present, it will wait
  263. some time to make sure that the leader has been reached.  If you do not
  264. rewind the tape completely, you will get a load error, since the O.S.
  265. insists on waiting for 9 seconds before even looking at the tape.  The same
  266. is true for the inter record gaps.  The O.S. will wait a small period of
  267. time because it wants to wait for a large portion of the IRG to pass by.
  268. Since these timing values are built into the Operating System, it is
  269. impossible to change these timing values without bypasing the O.S.
  270. completely.
  271.  
  272. Now that we know what is on the tape, let us see what happens when we try
  273. to read a tape.  When we start reading, we will first encounter the leader,
  274. which is a mark tone.  The O.S. will wait 9 seconds, and after that, it
  275. will start to load a block of data.  The mark tone is converted by the
  276. FSK-decoder in the cassette unit into a "1" level on the DATA IN line on
  277. the SIO bus.  The O.S. uses the POKEY chip to monitor the DATA IN line.
  278. The state of the DATA IN line can be monitored at bit 4 of the SKSTAT
  279. register.  The O.S. will wait until the DATA IN line drops to a "0" value.
  280. When this happens, we will have reached the startbit of the first byte in
  281. the block.  Since the first two bytes are the marker bytes, the O.S. will
  282. use these bytes to measure the bit-rate.  At this time, a counter value is
  283. saved, so that it can be used to compute the bit-rate, based on the
  284. difference in the counter values.  The O.S. will now watch the DATA IN line
  285. to see when the first ten bits have passed.  Then, it will look for another
  286. ten bits for the second marker byte.  When all these bits have passed, the
  287. counter value is taken again, and the difference is computed.  This value
  288. is used to access a table, which holds the value for the bit-rate register
  289. in the POKEY chip.  Once programmed with the proper bit-rate, POKEY will be
  290. able to convert the serial stream of bits into bytes, that can easily be
  291. obtained from the POKEY chip.  We start out by obtaining and storing the
  292. control byte.  After that, we have to retrieve the 128 data bytes.  Each
  293. byte is added to the checksum, and when the checksum byte is finally
  294. obtained from the POKEY chip, the computed checksum is compared to the
  295. checksum byte.  When things work as they should, these match, and the O.S.
  296. will report that the record has been read.  The marker bytes have not
  297. actually been read by the POKEY chip, but they are included in the
  298. checksum.  This is why the O.S. starts the checksum at hex-AA, which is the
  299. sum of two hex-55 bytes.  The O.S. will not need to convert the bits into
  300. bytes itself.  Neither will it have any part in detecting the tone on the
  301. tape.  The FSK-decoder inside the cassette unit will convert the FSK tones
  302. to serial data that is put on the SIO bus.  POKEY will convert this to
  303. bytes, once properly programmed with the proper bit-rate.  To the POKEY
  304. chip, this data looks very similar to the data that comes from a diskette
  305. drive.  Once again, when reading a cassette tape, all the audio processing
  306. is done strictly by the FSK decoder circuit within the cassette unit
  307. itself.
  308.  
  309. When data is saved to a cassette tape, POKEY will be used to generate the
  310. tones.  The audio signals generated by POKEY are simply recorded by the
  311. cassette unit.  When the cassette device is opened for output, the O.S.
  312. will put POKEY into the two-tone mode.  POKEY will also be programmed for a
  313. bit-rate of 600 bps.  Two beeps prompt the user to press return.  When
  314. return is pressed, the motor is started.  At this time, the leader is
  315. created, by simply waiting for 20 seconds.  Then the O.S. considers the
  316. open complete.  When the O.S. is called to save a record to the tape, the
  317. pre-record write tone is generated by waiting for either 0.25 seconds, or 3
  318. seconds if the motor has to be started again, as described earlier.  Then,
  319. the two marker bytes are put into the pokey register.  When these have been
  320. written, the control byte and the 128 data bytes are also put into the
  321. POKEY register one by one.  While doing this, the checksum is computed, and
  322. when all bytes have been written to tape, the checksum is written to the
  323. tape.  Then, either the motor is turned off, or left on, depending on the
  324. open mode.  Bytes are coded on the tape in ten bits.  First a startbit,
  325. which is a space tone.  Then, the eight databits are coded, starting with
  326. the least significant bit.  A bit that has a "1" value is encoded as a mark
  327. tone, a bit that has a "0" value is encoded as a space tone.  After the
  328. databits, a stopbit is encoded, which is a mark tone.  POKEY will use a
  329. tone of 5327 Hz for the mark tone, and a tone of 3995 Hz for the space
  330. tone.  Most of this sounds familiar, since we already discussed this when
  331. we were looking at how data is read.
  332.  
  333. Just the facts.
  334.  
  335. Stereo cassette tape, one data channel, one audio channel.
  336. Leader is 20 seconds mark tone.
  337. Normal IRG PRWT is 3 seconds mark.
  338. Short IRG is 0.25 seconds mark.
  339. Normal IRG PRG is up to 1 second garbage.
  340. Short IRG PRG is 0 to n seconds of garbage.
  341. Startbit is space.
  342. 8 data-bits "0" = space, "1" = mark, lsb first.
  343. Stopbit is mark.
  344. Mark is 5327 Hz.  Space is 3995 hz.
  345. Speed is 600 bps nominal, may run from 425 to 875 bps.
  346. Record starts with two marker bytes of hex-55.
  347. Control byte has a value of hex-FC for a full record.
  348. Control byte has a value of hex-FA for a partial record, the 128th data
  349. byte will indicate the number of bytes actually used.
  350. Control byte has a value of hex-FE when the record is an end-of-file
  351. marker, all data bytes will be zero.
  352. A tape record usually has 128 data bytes.
  353. A checksum is appended to the end of the tape record, it is computed by
  354. adding all bytes, adding the carry back in.
  355.  
  356. Reading data from a cassette tape.
  357.  
  358. Now that we know what we will find on a cassette tape, we can try to think
  359. of ways to retrieve the data that is stored on the tape.  An obvious method
  360. would be using an Atari cassette unit.  But that would be too easy.
  361. Besides, I do not like using those machines, just collecting them.
  362. Actually, it should be possible, but more about this later.  I was more
  363. thinking about ways to retrieve the data by means of software.  Since the
  364. data is encoded on the tape in an audio format, we can use regular audio
  365. processing tools to process the data.  What we need is a PC equipped with a
  366. sound card, some software to digitize the audio, and a lot of free hard
  367. disk space.  We have to convert the FSK tones into a wave file.  A regular
  368. audio cassette player should be connected to the sound card.  The tape is
  369. recorded in a stereo format, and we are only interested in the data
  370. channel.  We have to connect the sound card to the proper channel.  We can
  371. then start the wave recording program.  For reasons that I will explain
  372. later, we must set the sampling rate to 44,100.  We only want to record one
  373. channel, so we set it to mono, 8-bits, just to keep it in style.  This
  374. means that the audio will be sampled 44,100 times per second.  The level of
  375. the audio signal is represented by a value that ranges from 0 to 255, since
  376. that is the range that is available within 8 bits.  Therefore, each sample
  377. will be represented by one byte.  When the recording level is not adjusted
  378. properly, the value may range from about 30 to 220 or so, or similar
  379. values.  This does not really matter much, as long as the audio signal has
  380. a reasonable level.  Adjust it as you would with any other sound.  For my
  381. cassette player, this means I have to set the recording level control at
  382. the maximum.  When there is no audio signal, the level will be around 128.
  383. We can now start to record the audio signal to the wave file.
  384.  
  385. Tapes differ is length, depending on how much data is stored on them.  Some
  386. tapes are 16K or less, other tapes are 48K or more.  Most tapes require
  387. roughly 2.5 seconds per block of 128 bytes, which is 20 seconds per
  388. kilobyte.  A 16K tape will take about 5 minutes, a 48K tape could easily
  389. take 15 minutes or more.  At a sampling rate of 44,100 samples per second,
  390. we will have to store 44,100 bytes each second, or about 2.5 Megabytes per
  391. minute.  A fifteen minute tape will easily consume over 30 Megabytes of
  392. disk space.  I told you you would need a lot of free hard disk space.  If
  393. you do not have that much hard disk space available, you should backup some
  394. data and make space available, or simply buy a bigger hard disk.  Another
  395. option is to record only a portion of the tape, process that portion, and
  396. then process the next portion, and so on, until the entire tape has been
  397. processed.  Me, I am lazy, so throw hardware at the problem.  Hard disks
  398. are cheap nowadays.  When the entire tape has been digitized, we can stop
  399. recording to the wave file.  Make sure you rewind the tape before you start
  400. recording.  Most of the time, it is best to wait until you hear the leader
  401. before starting to record to the wave file.
  402.  
  403. Now that we have the cassette tape on our hard disk as data, we can start
  404. to analyze and interpret the wave data.  A wave file starts with a header
  405. that specifies the sampling rate and other technical stuff.  A wave file is
  406. a file in the standard RIFF file format, and documentation on this subject
  407. is available.  I did not invent this weird format, so if you want to know
  408. the details, get yourself a copy of that piece of documentation, or try to
  409. read the code.  (Hah, if it was hard to code, it should be hard to
  410. understand!).  This header is read and processed.  If the wave file is
  411. acceptable, processing continues.  After the header, we will find the
  412. sample data.  This sample data is a very huge list of PCM values ranging
  413. from 0 to 255.  From these samples, we have to form the bytes that are
  414. encoded in this audio pattern.  We know that we should only find the FSK
  415. tones in the audio.  The first thing we should do is to determine which one
  416. of the two tones is on the tape, the mark tone, or the space tone.  The
  417. only way to distinguish between these two is their difference in frequency.
  418. Therefore, we must think of an algorithm that determines the frequency of
  419. the tone.  Or rather, one that tells us whether it is one tone, or the
  420. other.   A tone has the form of a wave, hence the name wave file.  The
  421. audio level rises and falls continuously.  The number of times it rises and
  422. falls within one second is called the frequency.  The mark tone has a
  423. frequency of 5327 Hz, which means that within each second, it will rise
  424. from the minimum value to the maximum value and back to the minimum value
  425. 5327 times.  In other words, there are 5327 periods within one second.
  426. Since we are sampling at a sampling rate of 44,100 samples per second, this
  427. means that within each period, we will be taking about 8 samples.  If we
  428. are sampling a space tone, which has a frequency of 3995 Hz, we will be
  429. taking about 11 samples each period.  The way we can determine the
  430. frequency of the tone is now very simple.  We look at the sampled values to
  431. determine when the period is complete.  The number of samples within that
  432. period tells us what the frequency of the tone is.  If we counted 11
  433. samples, it was a space tone.  If we counted 8 samples, it was a mark tone.
  434. If it was anything else, well, we have a problem.  Of course, sampling is
  435. not begun exactly at the start of the period.  So we have to allow for
  436. slight differences.  Therefore, 10 samples will also be recognized as a
  437. space tone, and 9 samples will be recognized as mark.  From this, it is now
  438. obvious why a sampling rate of 22,050 or less will not work well.  We would
  439. have 4 samples for mark, and about 5 samples for space.  This is not enough
  440. of a difference, since the timing differences we mentioned just now could
  441. cause a difference of a single sample, causing a space tone to be
  442. recognized as a mark tone, or a mark tone as a space tone.  With the
  443. sampling rate at 44,100, we have enough of a difference to allow for these
  444. slight timing problems.
  445.  
  446. So how do we determine when a period is complete?  In the beginning, I
  447. tried to find the sinus wave form we all know, starting at the zero level,
  448. going up to the top, going back down passing the zero level again, going
  449. down to the bottom, and then back to the zero level again.  A classic
  450. sinus.  Well, in real life, you will not only find the two FSK tones on a
  451. tape.  For one thing, you can find noise.  There might be a hum
  452. superimposed on the signal.  A FSK-decoder will not be disturbed by this,
  453. since it has filters to get rid of these disturbing noises.  We have to
  454. remove these unwanted signals in software now.  A hum has a frequency that
  455. is around 50 or 60 Hz.  If the amplitude is fairly large, it will cause our
  456. zero level to shift up or down from the normal value of 128.  To compensate
  457. for this, we have to take the average value of the samples, and compute the
  458. zero level value based on this.  This was a big problem, since when the
  459. zero level is around 128, do we consider the value 127 to be positive or
  460. negative?  If the zero level is not determined exactly right, this might
  461. cause us to misinterpret a sample.  To reduce the problem, I boosted the
  462. sampling rate internally to 88,200 by computing the average value of two
  463. consecutive samples, and inserting that between the two.  This gave me more
  464. of a difference between mark and space, and it reduced the deviation that
  465. was caused by the samples with a value near the zero level.  Another
  466. problem is the fact that on some tapes the volume level of the mark tone
  467. differs from that of the space tone.  When the tone shifts from mark to
  468. space, it is hard to compute the average.  You would need to take the
  469. average of a couple of periods.  But then the hum is no longer removed.
  470. When there is a dropout on the tape, the audio level is reduced, or the
  471. audio is even totally gone.  I spent a lot of time trying to solve these
  472. problems, and the solution is simple.  Since it is hard to determine the
  473. zero level, it is best to come up with an algorithm that does not care
  474. about what the zero level is.
  475.  
  476. The current version is only interested in the count of samples within a one
  477. period time frame.  It does not matter where this period begins.  So let us
  478. not start at the zero level, since that is so hard to determine.  Let us
  479. start at the top level.  That is easy to recognize.  We only have to
  480. compare two consecutive samples.  If the second sample has a higher value
  481. than the first one, the sinus wave is going up.  If it is has a lesser
  482. value, it is going down.  That is very easy to determine.  When it is no
  483. longer going up, we will know that the previous value was the top value.
  484. We will be going down to the bottom value, passing the zero level
  485. somewhere, but who cares, and when we are going back up again, the period
  486. will be complete when the sample level reaches the top, when it starts to
  487. fall again.  This is true even if there is a hum or other noise
  488. superimposed on the signal.  The value of the top and bottom levels may
  489. vary, but we are not interested in the actual value.  We just want to see
  490. the level change from rising to falling or from falling to rising.  This
  491. algorithm is not troubled by any noise at all.  Now all we do is count the
  492. number of samples between two top levels, and since we know the sample
  493. rate, we can compute the frequency of the tone.  Or actually, we just want
  494. to distinguish between the mark and the space tone, so if the sample count
  495. is above a certain value, we will assume the tone is a space tone, and
  496. otherwise it must have been a mark tone.
  497.  
  498. Now that we know whether the current tone is mark or space, we can take the
  499. next step.  We want to know the duration of the mark and the space tones.
  500. Since one tone stops when the other starts, we can measure the duration of
  501. the mark and the space tones in pairs.  Each mark tone is followed by a
  502. space tone, which is followed by another pair of mark and space tones.  The
  503. duration of a tone is determined by summing up all sample counts that
  504. turned out to be of the same tone.  When we find the sample count indicates
  505. a mark tone, we add it to the sum of the duration of the mark tone.  When
  506. the next period is a mark tone too, we keep adding.  If it is a space tone,
  507. we start the space count of the pair, and continue counting space tone
  508. values until we encounter a mark tone again.  At this time, we move to the
  509. next pair and start summing the mark counts again.  In this way, we are
  510. building a table with count pair values, that holds the total duration of
  511. each mark and space tone on the tape as a sample count.  The duration of a
  512. tone is related to how many bits are encoded within that tone, so we can
  513. use this table to recover the bits from the tones.  The bits can then be
  514. assembled into bytes again.  This table would grow very long, and it is
  515. also easier to decode the bytes in blocks, since we have a checksum that
  516. can help in determining problems in decoding the data.  So when we hit the
  517. end of a record, we want to start decoding the data.  We know that after
  518. the end of a record, we might find any old noise.  This makes it hard to
  519. find the end of the record.  We do know however that after this, we will
  520. find the PRWT of the next record.  This is easy to recognize, since it is a
  521. mark tone of a considerable duration.  When the mark tone changes over to a
  522. space tone, we can look at the duration of the mark tone.  If the sum is
  523. above a fairly large number, we know that this mark tone was a PRWT tone.
  524. At this time, we can start to process the record, and then start our table
  525. all over again for the next record.
  526.  
  527. We now have this table of sample counts.  How do we convert this into
  528. bytes?  First we have to know how many samples there are within one bit.
  529. This depends on the baudrate.  If we find 600 bits per second on a tape,
  530. and we are taking 44,100 samples each second, a bit will last about 44,100
  531. samples divided by 600 bits, which is 73.5 samples.  Half a sample does not
  532. exist, so we know we have about 73 to 74 samples per bit.  We can now
  533. simply divide the sample counts in the table by 73, and then we will know
  534. how many bits are represented by each tone.  We know how the bits are
  535. written on the tape, so we can figure out the startbit, the eight databits,
  536. and the stopbit.  The table starts out with the PRWT, which can be found in
  537. the count for the first mark tone.  The count for the first space tone in
  538. the table must be the first startbit, so this should be a value of around
  539. 73.  If this is a standard tape record, we will find the two marker bytes
  540. at the beginning of the record.  The first databit we find will be the
  541. least significant bit.  It has a value of "1", so it is encoded as a mark
  542. tone.  Again the value should be around 73.  In this way we will be able to
  543. decode all bits of the first marker byte.  At the end, we will find the
  544. stopbit, which is a mark tone.  The next marker byte is exactly the same.
  545. Then we will find the control byte, and the 128 data bytes, and the
  546. checksum.  It is simply a matter of dividing the count values by the length
  547. of one bit.  During this process, we have to keep track of when to expect a
  548. startbit and when to expect a stopbit, since we have to throw these away.
  549. We only want to store the databits.  Since the marker bytes are meant for
  550. measuring the baudrate, this is what we will use them for.  We know that
  551. their bit pattern alternates, so we know that from the first space tone, we
  552. can find 20 bits alternating.  The count values of these 20 bits are added
  553. and divided by 20.  We then know the actual length of one bit, which
  554. usually turns out to be somewhere around 75 or so.
  555.  
  556. Well, this algorithm sounds easy enough, but what if a tone lasts only a
  557. few periods?  If the sample count of a bit is around 40 or so, it is too
  558. short to be a bit.  Well, there can be noise on the tape that causes our
  559. counting algorithm to fail.  In this case, you might get count values that
  560. are not a multiple of the bitlength.  This is a big problem.  The program
  561. can try to clean up these disturbances, by looking at the count values of
  562. the surrounding tones.  For instance, if a mark count of 40 is followed by
  563. a space count of 10, and then we find a mark count of 25, we can assume
  564. that the space count of 10 must have been a mistake, since a space tone of
  565. 10 samples is just one period.  We can then add all the counts, and we will
  566. ignore the fact that we recognized the space tone.  The result is a mark
  567. tone of 75 samples, which looks like a normal bit length.  This algorithm
  568. cleans up little mistakes.  But what if the mark count is 320 and the space
  569. count is 280?  This looks like 4 bits of mark tone, but we have a remainder
  570. of 20 samples then.  Well, we can simply throw away the 20 excess samples,
  571. but the 280 count of the space tone would be 3 bits with a remainder of 55
  572. samples.  This looks more like 4 bits.  This is why we cannot simply divide
  573. the count by the bitlength.  The program uses a repetetive subtraction.
  574. For each time we can subtract 75, one bit is recognized.  If the remainder
  575. is above 60 percent of the bitlength value, it is recognized as a bit, so
  576. 55 is still recognized as a bit.  This turns out to be the hardest part,
  577. where most of the errors occur.  If the sample counts are not a fairly
  578. reliable multiple of the bitlength, we must guess what the value is.  In
  579. some cases we get lucky.  Sometimes, we make the wrong descision.  When
  580. this happens, the decoding of bits fails to work.  Sometimes, we cannot
  581. tell where the startbit begins, and several bytes get lost, until we find
  582. some byte that causes the program to get synchronized again.  Of course, at
  583. the end of the record, we might realize that we only decoded 126 bytes
  584. instead of the 132 we were supposed to find.  Or we will find that the
  585. checksum does not match the computed checksum.  We might add powerful data
  586. restoration routines in this section of the decoding process.  However,
  587. sometimes it is just impossible to correct the values in the table.  If the
  588. tape had a dropout, there is no way you can properly decode the bits, since
  589. there is no audio on that portion of the tape.  You can try to guess the
  590. values though.  Some tapes have glitches and disturbances that you would
  591. not believe until you look at the wave file with a wave editor.  Most of
  592. the time, as long as the FSK signal is still present, the program will not
  593. be disturbed by this.  Sometimes it will though.  Currently, there is not
  594. much recovery logic in the program, since most tapes I have tested could be
  595. processed by simply trying to read the reverse side of the tape.
  596.  
  597. The output.
  598.  
  599. Well, now that we know how to retrieve the bytes from the audio, what will
  600. we do with them?  The bytes are stored in a cassette image file.  This file
  601. has a small header, so that it can be recognized as a tape image file for a
  602. Classic Atari computer.  This header starts with the word FUJI.  This
  603. header record must always be the first record in the file, so that we can
  604. always identify the file as a cassette image file.  A descriptive text is
  605. also stored in this header.  When processing the wave file, this
  606. description can be entered.  This description might be displayed when the
  607. cassette image file is processed, or when the data is sent to the Atari.
  608. The length of the description is stored, so that we know how long the
  609. header record is.  All records in the cassette image file have the same
  610. format, starting with a type identifier of four bytes.  The next two bytes
  611. indicate the length of the record, and they are always in the 6502 format,
  612. so first the low order byte, then the high order byte.  The next two bytes
  613. contain information that varies based on the record type, they are called
  614. the aux-bytes.  If they contain a number, it is stored in the 6502 format.
  615. These eight bytes are always present.  These bytes are not included in the
  616. length specification.  After these eight bytes, some record types contain
  617. data, and some do not.  The length bytes specify how much data to expect.
  618. If there is no data, the length bytes are zero.  There is no alignment, so
  619. the numbers cannot be treated as words or anything like that.  The header
  620. we discussed is simply a record type, like any other record type.  Because
  621. the first record must be a record of the header type, we can use it to
  622. identify the file.  The header records currently have no value in the
  623. aux-bytes, so they are zero.  After the header record, we might find a
  624. record telling us what the baudrate is at which the file should be
  625. processed.  The record type contains the word baud.  The baudrate is stored
  626. in the aux bytes.  There is no data for this record type.  After this, we
  627. will find a lot of data records.  A data block will contain 128 data bytes
  628. most of the time, but since the marker, the control, and the checksum bytes
  629. are also stored in the cassette image, the record will usually be 132 bytes
  630. long.  The record type contains the word data.  The length of the record is
  631. stored as usual.  If the record size is different, well, this will be
  632. indicated in the length bytes.  The duration of the PRWT is stored in the
  633. aux bytes measured in milli-seconds.  This is the current content of the
  634. .cas file.  Note that this leaves room for expansion.  Since each record
  635. has a record type identifier and a length specification, we can ignore
  636. records that are not supported by skipping them.  New record types might be
  637. added in the future.  For instance, we could scan the picture that is on
  638. the cassette inlay, and store the picture data in the .cas file with a
  639. special record type.  We could then show the picture of the cassette box
  640. while loading the program.  But we could do a lot of other things too.  For
  641. instance, we could create multiple header records, each with a description,
  642. in order to tell the user at what stage of the boot we are currently at.
  643. Creativity and time are the limiting factors here.
  644.  
  645. If the decoding process does not result in a clean cassette image file, we
  646. are forced to investigate what the problem is.  But how do we know how the
  647. program did?  Apart from the cassette image file, the program will also
  648. output a file containing the data in a hexadecimal notation.  It has an
  649. extension of .hex, and it is a simple text file.  It can be viewed with any
  650. decent text viewer.  It will contain a line of text for each data record.
  651. It contains the length of the PRWT, the length of the data record, and all
  652. the bytes.  The marker bytes, the control byte and the checksum byte are
  653. also simply treated as data, so all bytes are visible.  The checksum is
  654. computed, and it is compared to the checksum byte.  The result of the
  655. comparison is indicated at the end of the text line, by either putting "ok"
  656. or "bad" at the end of the line.  The computed checksum is stored next to
  657. the checksum byte, so we can see what the current value is, and what the
  658. expected value is.  Lines that are marked bad mean trouble.  If the record
  659. length has a weird value, you will know that there is a problem with
  660. recognizing the bits, maybe because of erroneous mark or space counts.  If
  661. we could simply correct these problems within this text file, we would be
  662. able to recover bad tapes.  This would only be possible if we know what
  663. bytes are missing.  The missing or incorrect bytes can then be corrected.
  664. But then we would need a program that will take a .hex file and convert
  665. that to a .cas file.  This should be fairly easy, but I have been too busy
  666. to write such a program.
  667.  
  668. If you want to investigate a little deeper what caused the problems, you
  669. can look at the .fsk file.  It will contain all mark and space count pairs.
  670. This is also a simple text file, that can optionally be generated.  Each
  671. line starts with the byte offset of the PCM data.  We can take a look at
  672. the wave file with a wave editor, and this offset value can be entered in
  673. the wave editor to position it at the problem area.  We usually find
  674. something here that caused the disturbance.  It might seem complicated to
  675. interpret the mark and space counts, and it probably is.  But you should
  676. not be trying to understand what is encoded.  If you want to use the FSK
  677. file to correct problems, you should only try to correct the things where
  678. the wrong tone was detected.  After changing the counts, the file should be
  679. processed in a similar way as we would normally process a count table.  The
  680. mark and space counts could then be converted to bits and bytes again.
  681. Again, we would need a program to do this, and this could apply the same
  682. logic as discussed.
  683.  
  684. During the development stage, I had the program print a lot of information
  685. to the screen.  However, printing several megabytes to the screen takes a
  686. lot of time, and you have to be reading as fast as Mr Data to keep up with
  687. the computer, so I redirected the output to a file.  All the relevant data
  688. can then be examined at your own pace.  Well, as you might guess, all these
  689. files take up a lot of hard disk space too.  I told you you needed a big
  690. hard drive.  Since these text files are very large, you need a program that
  691. can cope with large text files.  If you also want to change or edit the
  692. text files, you need an editor that allows you to edit files of a few
  693. megabytes.  Don't even think about using the regular DOS editor, which is
  694. no good for anything except for editing config files.  Well, if you are
  695. only interested in the .hex file, it might be able to handle that.  But the
  696. diagnostic data is a couple of megabytes, when redirected to a file.  One
  697. of the things I looked at to discover problems is the total count of the
  698. number of samples per byte.  Since each byte is encoded in 10 bits, you
  699. should have about 735 samples per byte.  The actual value does not matter,
  700. as long as all bytes are about the same size.  If, at some point in the
  701. record, you see a large deviation from this average length, you know that
  702. this is a problem area.  Come to think of it, this would be a far better
  703. algorithm for cleaning up the table automatically.  Since each byte ends
  704. with a stopbit, which is a mark tone, and the next byte starts with a
  705. startbit, which is a space tone, we know that when the space tone changes
  706. to a mark tone, this mark tone might include the stopbit.  We only have to
  707. look at the sum of the sample counts to determine this.  Better yet, we
  708. could go look for the stopbit first, and then decide how to clean up the
  709. bits within the byte, if the sample counts cannot be divided evenly by the
  710. bit-length.  But this version seems to work for now.
  711.  
  712. Tape quality and such.
  713.  
  714. A while back, we discussed lengths of bits.  When you have a lot of tapes
  715. from different manufacturers, you can see that these tapes differ a lot in
  716. audio quality.  I am not talking about how these tapes perform on an Atari
  717. cassette unit here, although that might be affected too.  I am strictly
  718. speaking about the technical quality of how the data is written on the
  719. tape.  The tones that are written on the tape should be pure, so that no
  720. distortion will be able to confuse the FSK-decoder.  Well, since POKEY can
  721. generate pure tones, that is not a problem.  But when the data calls for a
  722. shift from mark to space, or the other way round, what we see at the spot
  723. where the tone changes varies a lot.  Some tapes show a brief disturbance.
  724. Some tapes simply change the tone of the wave without disturbing it.  What
  725. we can notice here is that there are two tones that are recorded on the
  726. tape.  When we need to change the tone, some tapes immediately change the
  727. tone right then and there.  However, the period usually is not complete at
  728. that time.  Changing a tone in the middle of a period always causes
  729. distortion.  Clean tapes will wait until the tone reaches the zero level
  730. before changing the tone.  Technically, this is a better quality tape.
  731. Sometimes, tapes are written by professional FSK generators.  These have
  732. two tone generators, since it is almost impossible to have a generator
  733. produce a pure tone the moment it is switched on.  In fact, it may take a
  734. while before it can generate any tone at all.  That is why these tone
  735. generators are on all the time.  If we simply use some sort of switch to
  736. choose between these two tones, switching from one tone to the other will
  737. cause distortion.  When we wait until the tone reached the zero level
  738. before switching, we cannot be sure that the other tone will be at the zero
  739. level at that exact moment.  As a matter of fact, since the frequency of
  740. the two tones differs, it will probably never be exactly at the zero level
  741. then.  We should make sure that we switch over to the other tone when that
  742. tone is at the zero level too.  This means the tones have to be somewhat in
  743. phase.  With the frequencies specified by Atari, this is impossible.  These
  744. frequencies were choosen because POKEY can generate them.  If we want the
  745. tones to be in phase at the time a change can occur, we must change the
  746. frequency of one of the tones slightly.  The FSK-decoder can cope with some
  747. deviation from the standard frequency.  We might even change both tones a
  748. little.  On top of that, we can adjust the baudrate a little, so that we
  749. can make the change of the tone real smooth.  This might mean that the bit
  750. is slightly longer or shorter than it should be, and the "1" bit might have
  751. a different length than the "0" bit, but as long as we do not deviate too
  752. much, the improved sound quality is worth it, since the FSK-decoder will
  753. have less noise to deal with.  Well, that is nice for the FSK-decoder, but
  754. how about our program?  If the bit is longer, we will have to allow for
  755. these tolerances.  Well, trust me, especially this program does not like to
  756. deal with distortion caused by the change in the tone.  As a matter of
  757. fact, POKEY does not care when it changes the tone.  It just does it the
  758. moment the time for the previous bit is up.  Tapes saved on a real Atari
  759. thus are not very clean, and we will have more trouble reading them.  Just
  760. take a look with the wave editor, and you will see what I mean.  Allowing
  761. the bit length to vary is easy though.
  762.  
  763. Since we are returning to the baudrate topic again, can we increase the
  764. baudrate on the tape?  Well, now that we know what is supposed to be on the
  765. tape, we could generate a tape with a higher baudrate, as long as we still
  766. use the specified frequencies for the mark and space tones.  All we have to
  767. do is make the bits shorter.  We talked about cleaning up tapes earlier.
  768. If we want to generate a FSK audio signal again, based on the contents of
  769. the .cas file, we could write a new and improved tape.  What we need is a
  770. program that converts the data to a wave file again.  This wave file can
  771. then be played through the sound card, and we could record it using an
  772. audio cassette recorder.  Since I have have been too busy decoding data,
  773. writing a program to encode data would be a nice change, if I only had
  774. time.  The technical quality of the tones would not be limited by a tone
  775. generator, since we can digitally compute the values for the tones.  This
  776. could really clean up the quality of a tape.  We can also choose the
  777. baudrate we want to use, so we could increase it to 875 baud.
  778.  
  779. As we discussed, some tapes have a special tape format.  They start by
  780. loading their own tape handler, and then it takes control and bypasses the
  781. O.S.  Then, tape records of 1024 bytes of more are used.  Since our program
  782. is unaware of the fact that the rules imposed by the O.S. are no longer in
  783. effect, we do not know how to handle some tapes.  If the length is the only
  784. difference, this is usually not a problem, since the program was designed
  785. to cope with that.  As a matter of fact, if we would not have to worry
  786. about this, we would know that a record must always be 132 bytes, and
  787. ignore any bytes beyond that.  Sometimes, the program interprets the PRG as
  788. data, and thus some records are assumed to be 133 bytes or more.  The
  789. checksum will appear to be incorrect, although when trying to load a file
  790. like this, the Atari will treat the excess bytes as PRG and ignore them.
  791. Since a number of tapes have a non-standard format, we do worry about this.
  792. I have tried some tapes with a weird format, and this does work, so, if you
  793. really want to get rid of these excess bytes, you should either modify the
  794. program, or change the .hex file, and write a processing utility for it.
  795. If you do, upload it!  Some files with this weird format have a funny way
  796. of storing the checksum.  They have a checksum of two bytes or more.
  797. Sometimes, this checksum appears to be a separate very short record.
  798. Sometimes, the records do not have marker bytes.  However, we still apply
  799. the marker bytes algorithm to compute the bit-rate, since we do not know
  800. that the O.S. rules are no longer obeyed.  If the result is some weird
  801. bit-rate, we are either processing noise, or one of these non-standard
  802. records.  If there are only a couple of sample count pairs, we treat it as
  803. noise.  Otherwise, we assume the standard bit-rate of 600 bps, and hope for
  804. the best.  I do not know if the program can convert all tapes that exist.
  805. If you run into very weird tapes, the program might have to be modified.
  806. The various text files that are output might have problems with the very
  807. long line length.  The .hex file for instance would still have all the
  808. bytes of a record on one line, and thus it might be a couple of thousand
  809. bytes long.  Some editors crash if the line is too long.  Again, get
  810. yourself an editor that can cope with this, or modify the program.
  811.  
  812. Just a few words about sampling audio are in place.  I have tried a couple
  813. of programs to record audio to a .wav file.  One of the things to watch is
  814. the fact that you will be recording a lot of data.  If your hard drive is
  815. fragmented, the system will need more time to save the data.  Since the
  816. sampling rate is high, this could cause your sample recording program to
  817. lose a few samples while it is busy saving data to disk.  I did not program
  818. that stuff, I would assume the program continues to store samples in
  819. memory, but somehow it looks like the O.S. disasbles the interrupts while
  820. doing I/O, so it will simply miss a few samples sometimes.  This might also
  821. be caused by the fact that there are other tasks in the system that are
  822. allowed to use the system resources for a while.  I have seen this happen
  823. with an Operating System that was released in 1995.  If you look at the
  824. wave file with a wave editor, you can sometimes see the spot where the
  825. system could not keep up, especially if this is one of those very clean FSK
  826. tapes.  Since this occurs randomly, it is hard to do anything about it.
  827. You could do it like I did, simply create a 32 meg ramdisk and run DOS, but
  828. not everybody is so fortunate to have memory in abundance.  A fast hard
  829. drive is nice too, and it will do most of the time.  If you cannot avoid
  830. this, simply record the file again, and you will probably experience this
  831. problem at another spot on the tape.  You will need to cut and paste then
  832. to get a clean tape by replacing the portion that was distorted.  All you
  833. have to do is find the IRG, cut away the bad record, and insert the good
  834. copy.  You might even record only that record.
  835.  
  836. Sending a cassette file to the Classic Atari.
  837.  
  838. Now that we have a cassette image file, we would like to be able to load it
  839. into the Classic Atari.  The program CAS2SIO will allow you to use your PC
  840. as a replacement for the cassette unit.  All you need is the PC, the
  841. cassette image file, and a SIO2PC interface.  No sound card is needed.  The
  842. program will read the cassette data and send it to the Classic Atari on the
  843. SERIAL IN line, just like the cassette unit does.  There is a slight
  844. difference though.  There is no motor control line in the SIO2PC interface.
  845. Well, that is not a big problem, since we do not actually need it most of
  846. the time.  For instance, if we are loading a boot-tape, we know that we
  847. want the data to be sent, so we do not need to tell the PC to start the
  848. motor, which does not exist, it will simply send the data as instructed on
  849. the PC keyboard.  We only need to enter the command for the PC, then we can
  850. switch on the Classic Atari, telling it to boot from tape, and if we are
  851. quick enough, the PC will still be sending the leader.  Booting will then
  852. simply proceed as usual.  If the Atari tells the motor to stop, we will
  853. have a problem.  I have not seen this yet though.  The motor is supposed to
  854. stop when the boot is complete.  Some multi-stage bootloaders turn the
  855. motor on again, after waiting for some introduction screen, or after
  856. setting up some data.  This has not been a problem so far, since the PRWT
  857. will usually be long enough.  The PC will be sending the PRWT of the next
  858. record, and most of the time, the Atari will want the next data record
  859. before the PRWT runs out.  If the Atari needs more time, this will be an
  860. inconvenience.  All we have to do is go and change the length of the PRWT
  861. of that record, so that the PC will wait a little longer.  You will need a
  862. file-editor for this, or the utility that processes .hex files.
  863.  
  864. I tried to keep the CAS2SIO program very simple.  After all, all it has to
  865. do is read the cassette records and send them over the serial port of the
  866. PC.  The BIOS allows us to set the speed of the serial port to 600 baud, so
  867. that is all we need.  Unfortunately, the hardware in the PC did not agree
  868. with me on that.  When I tried to send a byte, it insisted on a couple of
  869. handshaking signals to be present on the serial port of the PC before
  870. sending anything.  With a breakout-box and a couple of wires, I was able to
  871. provide these signals, but that would require all of you, and me, to modify
  872. the SIO2PC cable.  That is why the program is a little more complicated,
  873. since it goes directly to the serial chip, the UART inside the PC.  It does
  874. this by addressing the port at which the chip is connected.  This way, we
  875. can bypass the BIOS within the PC, and thus simply ignore the fact that the
  876. handshaking signals are not present.  Since we are already bypassing the
  877. BIOS, we can now also program this UART to use non-standard baudrates.  We
  878. can program it for any value we like, up to the limit of our various
  879. hardware components.  For cassette usage, this means we can go up to 875
  880. baud.  The most important is that we do not have to modify the interface.
  881. We can use our standard SIO2PC cable now.
  882.  
  883. Other programs for cassettes.
  884.  
  885. There are a number of other tools and utilities that might be useful.  I
  886. have been working on this project for several months, so I did not have
  887. time to work on the utilities I would like to see.  At the moment, I doubt
  888. that I will work on those.  It is not even clear to me how much more time I
  889. want to invest in this program.  It seems to work most of the time, so as
  890. long as I can process our own tapes, I have no need for improvements.  For
  891. people that are interested in cassette tapes, and like to program something
  892. themselves, here are some of the things that might help in processing
  893. tapes.  To begin with, some of the programs were already mentioned.  It
  894. would be nice if there would be some programs that would be able to process
  895. the .hex files, or the .fsk files.  The need for these is obvious.  In
  896. fact, if I had to design this project from scratch again, I would make an
  897. interactive version, that would present each record in the form of the FSK
  898. table to the user for manual correction.  This would eliminate the need for
  899. separate programs.  On the other hand, working with text files allows for
  900. processing at your leisure, without the need to process the file in one
  901. session.  Besides, an interactive version would require a lot of screen and
  902. file handling, and I feel that sort of thing always distracts from the
  903. problem at hand.  This program currently only uses standard 'C' input and
  904. output routines.  This means that it is very portable.  As a matter of
  905. fact, it compiles without modification on my Atari ST with Turbo-C.  Well,
  906. the CAS2SIO program will not compile, since it goes directly to the PC
  907. hardware, so if you want to use that on another sytem, you will have to
  908. write your own version.  But what you find in the 'C' source code is
  909. related to the processing of the data only.  If someone would want to write
  910. a version with a graphical interface, maybe even in another language, only
  911. relevant information is found in the source.  No screen or file editing
  912. stuff is obscuring the algorithms.  Besides, this project started out like
  913. all of my projects, I had an idea, came up with an algorithm, and just
  914. started hacking at it.  This program is just one big hack.  When the
  915. algorithm did not quite work, I adapted it.  Now that it works most of the
  916. time, I started documenting it, and cleaning up the code a bit.  I try not
  917. to spend time on the graphical stuff, since my time is limited, and the
  918. results count.
  919.  
  920. Another useful tool would be a program to convert a .cas file into a clean
  921. .wav file.  This was also mentioned already.  We could create an improved
  922. tape this way, cleaning up noise, or making the technical quality of the
  923. FSK tones a lot better.  We could increase the baudrate.  Or we could
  924. create a tape in a stereo format, which would allow us to have full control
  925. of the audio channel.  If you like tapes, this opens possibilities that
  926. allow limited authoring of tapes.  We could add a sound track to the tape,
  927. maybe even from digitized sound produced by the game itself.  All we have
  928. to do is to sample the audio once the game is loaded.  We could then merge
  929. that with the data, and create a stereo .wav file, that we could record
  930. using a stereo cassette tape recorder.
  931.  
  932. Another program we might write could eliminate the need for lots of hard
  933. disk space.  we are now using the PC to emulate the cassette unit.  We are
  934. sending data on the SIO bus.  We could reverse things a little.  We could
  935. use a real cassette unit, and then simply retrieve the bytes from the SIO
  936. bus, using a SIO2PC interface and the serial port of a PC.  We would have
  937. to connect the cassette unit to a real Atari, otherwise the motor will not
  938. start.  Some cassette units draw their power from the SIO bus, so another
  939. reason why the Atari computer should be connected.  As a matter of fact, so
  940. does the SIO2PC interface.  Now some cassette units do not allow you to
  941. daisy chain another device to the cassette unit.  If your SIO2PC interface
  942. does not allow this either, you will not be able to connect both at the
  943. same time, so then forget this.  Unless you get yourself another cassette
  944. unit.  If we start the cassette unit, it will put the data on the DATA IN
  945. line.  If we program the serial port of the PC at 600 baud, we could listen
  946. in on the data that is on the bus.  We would not have to do any decoding at
  947. all, since the serial port chip inside the PC would do all the work for us.
  948. One problem you will need to solve though.  The SIO2PC interface listens on
  949. the DATA OUT line, and it speaks on the DATA IN line of the SIO bus.
  950. However, this time we want to listen on the DATA IN line, since this time
  951. we are sort of acting the same as the Atari computer.  You would have to
  952. change your interface.  You would have to disconnect the DATA OUT line, and
  953. connect the DATA IN line to the interface at that point.  Another problem
  954. would be that you would have to measure the length of the PRWT using some
  955. sort of timer, unless you assume a standard length of 0.25 seconds.
  956.  
  957. There is a lot more we can do with cassettes.  We can convert them to disk.
  958. With some cassettes, this is hard, because they contain a special boot
  959. loader, or some weird tape format.  Now that we have the data in a file,
  960. converting this data to some disk format is a lot easier.  It might not be
  961. simple, but at least it is easier.  I have converted some tapes before, and
  962. the hardest part was getting the data from the tape.  Writing a simple disk
  963. boot loader is relatively easy.  But we only want to copy the stuff to disk
  964. for speed.  So if we could increase the baudrate, that would be good
  965. enough.  To do this, we could write a small cassette handler that is booted
  966. from the tape at regular speed.  If we let this bypass the O.S., we could
  967. increase the baudrate beyond the 875 baud limit.  We could increase it to
  968. 19,200 or more, and then load the tape very fast.  Bypassing the O.S. is
  969. not that simple though, since replacing the C: handler vector will not work
  970. all the time.  For the boot stuff, the O.S. calls the cassette block
  971. functions directly, by calling the SIO block routines for the cassette
  972. pseudo device.  This looks like an interesting challenge.  We could make
  973. this format compatible with a real tape, so that we could actually create a
  974. cassette tape that will load fast all by itself.  On the tape we are
  975. limited by the resolution provided by the frequencies of the mark and space
  976. tones.  Depending on the quality of the FSK-decoder circuit, the hardware
  977. will need some time to detect the frequency of the tone.  I can imagine
  978. that it would at least need one period for this.  If we would be using a
  979. baudrate of 19.200, we would have less than a quarter of a period for each
  980. bit.  I do not believe the FSK-decoder would decode the frequency of the
  981. tone fast enough.  I have not tried this though, so, this sounds like
  982. another area where no one has gone before.  Still, we might be able to
  983. double the speed, or more.
  984.  
  985. Command line options.
  986.  
  987. Running the WAV2CAS program is easy.  You have two options.  You can run it
  988. interactively, by simply starting it.  It will ask for the filename.  Once
  989. that is entered, it will ask you to enter whether or not you want the FSK
  990. file to be created.  You are then asked to enter the description for the
  991. cassette.  This will be placed in the cassette header.  The diagnostic
  992. option cannot be selected in the interactive mode.  If you wish the
  993. diagnostic data to be printed, it would be printed to the screen.  This
  994. output can be redirected to a file using the standard DOS redirection.
  995. This redirection would cause all the prompts to be redirected to that file
  996. too, so that is why this option cannot be selected in the interactive mode.
  997. You can enter all this on the command line if you prefer.  The printing of
  998. diagnostic data is an option switch, which can be selected by adding /d to
  999. the command.  You can also select that the FSK file should be generated.
  1000. Adding /f as an option switch will cause the FSK file to be generated.  The
  1001. file to process is the first argument on the command line.  The description
  1002. is optional, and if it is present, it is the second argument.  Since the
  1003. description can contain spaces, you must enter the description as a quoted
  1004. string.  So if we want to process a file named demo.wav in the \cassette
  1005. directory, we would enter:
  1006. wav2cas \cassette\demo.wav "A demonstration program" > demo.txt /d /f
  1007. This would select the printing of diagnostic data, redirecting it to the
  1008. file demo.txt in the current directory.  The .fsk, the .hex and the .cas
  1009. files are all output to the directory where the .wav file resides.
  1010.  
  1011. The command line options for the CAS2SIO program are very similar.  This
  1012. program only requires the .cas file, so this is the only command line
  1013. argument.  The option switch allows selecting the COM port to be used,
  1014. either COM1, 2, 3 or 4.  The default port is COM2.  Loading the file
  1015. created above using COM1 could be accomplished by entering:
  1016. cas2sio \cassette\demo.cas /1
  1017. If no command line arguments are given, the program will prompt for the
  1018. file and the COM port to use.  If you would like to use another com port,
  1019. you should modify the program, or write your own.
  1020.  
  1021. Command line options can be placed anywhere on the command line, and
  1022. options can be combined, so entering /df has the same effect as entering /d
  1023. /f.  Both programs allow the user to exit the interactive request for data
  1024. by entering control Z.  On most PC's, pressing control-BREAK will also
  1025. terminate the program.  I used the Symantec C++ compiler on the PC.  If you
  1026. press control-BREAK, it will terminate the program as soon as it tries to
  1027. write to the screen.  If the CAS2SIO program happens to be in the middle of
  1028. the leader, this may take a few seconds though.
  1029.  
  1030. Troubleshooting.
  1031.  
  1032. Well, what to do if the program is unable to create a correct .cas file?
  1033. This means you have a big problem.  There is a number of things you can
  1034. try.  For one thing, check to see that the tape was sampled at the correct
  1035. sampling rate.  A sampling rate of 44,100 is required.  The program will
  1036. accept tapes sampled at 22,050, but that is just for experimental purposes.
  1037. I wanted to see if it could process tapes that were sampled at that rate.
  1038. So far, results are disappointing.
  1039.  
  1040. Also check to see if the recording level can be adjusted.  If the recording
  1041. level is too low, noise will be more likely to disturb the process.  If the
  1042. level is much too high, the tones will be distorted.  If there is some hum
  1043. or other noise superimposed on the signal, make sure the total amplitude
  1044. stays within the limits.  It is better to be able to see the signal with
  1045. interference, than it is so see a level of 255 for a number of samples in a
  1046. row.  If the recording level cannot be adjusted to a satisfactory level,
  1047. check to see that you are recording the proper channel.  Simply try the
  1048. other channel to see what happens.
  1049.  
  1050. Sometimes, the recording of data can be suspended due to various O.S.
  1051. related issues.  If you feel that a data block has been hit by this, try
  1052. recording the tape again.  Most tapes are recorded on both sides.  You
  1053. could try recording the other side.  If a certain portion of a tape is
  1054. damaged, or suffers from a dropout, you could try to sample both sides, and
  1055. use a wave editor to replace bad pieces from one recording by pieces from
  1056. the second recording.  This can be a tough job, since to us, all blocks
  1057. sound alike.  But it should be possible.  Simply counting the blocks might
  1058. help.  Most cassette decks have a tape counter.  I suggest you use it.  If
  1059. there is a very small glitch that confuses the program, you could try to
  1060. see what happens if you simply cut away the bad spot with the wave editor.
  1061. Be careful though, since the length of one bit is about 75 samples.  If you
  1062. cut away more than 20 samples, the bit will be too short.  You could try
  1063. replacing it with a piece of mark tone, or a piece of space tone, that you
  1064. copy from another piece of the tape.  This would be a tape transplant so to
  1065. speak.  I have not tried this yet, but it should be possible.  Since we are
  1066. dealing with very large .wav files here, editing them might take a while.
  1067. I do not even know whether or not this can be done at all.  I would
  1068. recommend this only if there is no easier way to correct the problem.
  1069.  
  1070. A much simpler way of editing the data would be to simply sample both
  1071. sides, and processing both sides.  The resulting .cas files or .hex file
  1072. could then simply be merged.  For instance, if the first half of the A-side
  1073. of the tape is fine, you could only sample that first half and process it.
  1074. You could then sample the second half from the B-side, and after processing
  1075. that, you could merge the files with the COPY command.  You can either
  1076. merge the .cas files, or you can merge the .hex files.  You could clean up
  1077. the new .hex file, and generate a new .cas file from this.  The only
  1078. problem with this would be getting the length of the PRWT to be acceptable
  1079. at the point where the two files are merged.  This is why it would be best
  1080. to use the .hex file, if we had that converter for it.
  1081.  
  1082. The method just described can also be used if you just do not have the hard
  1083. disk space available to sample an entire tape at once.  You could sample
  1084. say 25 records, then process these, and then delete the .wav file so you
  1085. can process the next 25 records.  You would have to repeat this process
  1086. until all records have been processed.  This is a tedious job, and it is
  1087. easy to make a mistake.  But if you are careful, you might be able to do
  1088. it.  You would have to do a lot of work to merge the files in the correct
  1089. order too.  But if you just do not have the hard disk space available,
  1090. there is not much else you can do, except buying a bigger hard disk maybe.
  1091.  
  1092. If you have trouble booting the cassette tape image with the CAS2SIO
  1093. program, there are some things you could try.  You would think that once
  1094. you have the data on a reliable medium, like a hard disk, you are forever
  1095. freed of the dreaded boot errors.  Think again.  During the tests in my
  1096. lab, the living room, I have found that some of the load errors are not
  1097. caused by the cassette unit at all.  As a matter of fact, some of the boot
  1098. errors are caused by the Operating System.  Or, if you prefer, by
  1099. programmers that did not take into account how the Operating System works.
  1100. I will try to explain.  Like we mentioned before, if the leader is too
  1101. short, the O.S. will still be waiting for the leader to pass by, while the
  1102. first cassette data block is already being transmitted over the DATA IN
  1103. line.  By the time the O.S. feels it is time to start looking at the data
  1104. on the tape, the data has already passed, so a boot error will occur.  This
  1105. can happen if you start the CAS2SIO program on the PC and spend more than
  1106. 10 seconds trying to switch on the Atari.  If you sampled only a portion of
  1107. the leader, the length of the leader in the first data record of the .cas
  1108. file might be too short.  You might try and make it a little longer with
  1109. some of the editing tools.  The leader is the PRWT of the first data
  1110. record.  Well, that is, the leader is added to the length of this PRWT, but
  1111. in effect, this value becomes the length value of the PRWT as specified in
  1112. the aux bytes.  By increasing the length, you will have some more time to
  1113. get the Atari booted.  This sort of timing problem may also cause boot
  1114. errors in a multi-stage boot.  During my experiments, I had a clean .cas
  1115. file.  All records had the proper checksum, and yet, every other time I
  1116. tried loading the program, it would produce a boot-error at the third stage
  1117. of the boot.  Appearantly, the program did some setup processing, and by
  1118. the time it got around to reading the next cassette record, the remaining
  1119. PRWT tone was too short to be a proper PWRT.  I then increased the PRWT for
  1120. that record, and since then I have had no boot errors.  So, this shows that
  1121. the boot errors are sometimes caused by timing problems, due to low
  1122. tolerance levels.  Writing a new tape with improved timing might make the
  1123. real tape more reliable too.
  1124.  
  1125. Some tapes may appear to have been converted without problems.  If you look
  1126. at the .hex file, and all records show "ok", you might think that there is
  1127. some other problem why the tape does not properly boot.  Well, it might be
  1128. caused by a record that was skipped as noise.  This is highly improbable,
  1129. since the current version will allow even very short records to exist on
  1130. the tape.  In my first versions, the program would discard any data as
  1131. noise if it was not able to detect the marker bytes.  Since some tapes have
  1132. a strange checksum record in their custom format, these records got lost,
  1133. so I changed the program such that it will only ignore records that are
  1134. very short.  However, if this caused a checksum record to be lost, you will
  1135. have a problem.  It will not show up as a bad record.  The only thing you
  1136. could do is listen to the tape and count the records.  If you find a
  1137. different record count than the number of records in the .hex file, you are
  1138. in serious trouble.  The only thing you can do is change the program, and
  1139. remove the garbage filter.  But what if you have more garbage than you
  1140. need?  If the program tried to recognize some noise as data, it will be
  1141. stored in the cassette image file.  Sending this short data block might
  1142. cause the Atari to get confused, and respond with a boot error.  You would
  1143. have to remove this erroneous data block with the tools already mentioned.
  1144. The problem is, that these tools do not yet exist.  Well, there is one
  1145. trick you can use.  The format specification tells you that any data that
  1146. is not recognized or not supported, should simply be ignored.  If you
  1147. change the type identifier from "data" into "bad " or something like that,
  1148. the record would be ignored.  A simple file editor will allow easy
  1149. disabling of this record, without the need for deleting bytes.
  1150.  
  1151. During my tests, I had a few tapes that just did not seem to work.  After
  1152. booting them, the system just appeared to be hung.  Well, before you try to
  1153. load any of your old tapes, make sure you know what procedure to follow in
  1154. order to boot these tapes.  The tape might not be compatible with the XL/XE
  1155. O.S., or you might need a certain amount of memory.  Another thing that
  1156. amazed me sometimes is that some of the commercial games are written in
  1157. BASIC.  Trying to boot a tape with a program that was CSAVE'd will yield
  1158. interesting results.  Or rather, they are boring.  A BASIC save-file will
  1159. usually have a couple of zero bytes at the beginning.  If you try to use
  1160. this as a boot cassette, it will attempt to boot 256 records.  Most BASIC
  1161. files are shorter, so after the tape runs out, and after some pause, you
  1162. will get a timeout, and thus a boot error.  So, use CLOAD instead on these
  1163. tapes.  Anyway, make sure you know the proper procedure for the tape.
  1164.  
  1165. It happened to me a couple of times that the CAS2SIO program just did not
  1166. seem to work at all.  It turned out that I forgot to tell the program that
  1167. my SIO2PC interface is attached to COM1, so if you are not using COM2, make
  1168. sure you specify what COM port to use.  If your PC has a COM3 or COM4, you
  1169. should be able to use these without any problems, since the interrupts are
  1170. not used.  The program tries to get the port address from the BIOS data,
  1171. but if that is not available, the default values are used.  If you are
  1172. using other values, the program must be modified.
  1173.  
  1174. Epilog.
  1175.  
  1176. Well, we have finally come to the end of this document, for now.  It is
  1177. bigger than the source code I'm sure.  But anything worth writing is worth
  1178. documenting I suppose.  Since I have been spending a lot of time on
  1179. cleaning up this stuff and documenting it, I have not had time to actually
  1180. process tapes a lot.  As you might understand, sampling about 350 tapes
  1181. might take a while.  Processing them takes time too, and you can only store
  1182. a few .wav files on a gigabyte drive.  But you just volunteered as a
  1183. tester.  Call this alpha-testing, betha-testing or whatever.  If I would
  1184. charge you a lot of money, and ask you to pay again for the update, over
  1185. and over again, I might even call it a product.  But since I think that
  1186. nobody is prepared to send me a million dollars for freeing them of the
  1187. menace of the cassette units, I suppose I will not be able to quit my
  1188. daytime job.  Too bad, since that means I might not work on this project
  1189. for some time.  Well, since I am including the source code, anybody that
  1190. was about ready to start complaining about the program is very welcome to
  1191. improve on my stuff.  I will probably not have time for it for the rest of
  1192. the year.  You see, we have to work on Pooldisk II sometime.  So, use this
  1193. stuff at your own risk.  I am not responsible for any damage that might
  1194. occur whatsoever.  If you want to take portions of my program and improve
  1195. on it, go ahead, provided that you comply with a few rules.  You have to
  1196. include in your documentation that your program was based on this work.
  1197. Yes, that means that you have to write documentation too!  Hah, that would
  1198. stop anybody.  On top of that, if you charge money for your product, you
  1199. will have to inform people that my stuff is available free of charge.  This
  1200. includes shareware fees and stuff like that.  If you do write a slick
  1201. program, I would like to wish you good luck.  If it is a major improvement
  1202. over my version, I would welcome that a lot.  If people agree that it is a
  1203. major improvement compared to the free version, they might want to spend
  1204. some money on it.  I just want people to know that this thing is available
  1205. for free.  This means that I myself do not expect people to send me any
  1206. money.  So, you get what you pay for with my stuff.  Well, maybe it works
  1207. for you.  If you do want to get rid of your money, send some of the regular
  1208. shareware authors some.  After all, where would we be without the people
  1209. that wrote programs like SIO2PC?  There would not be a SIO2PC cable then,
  1210. and I would not have thought of this application for it.  There are
  1211. numerous other authors out there, still working hard to improve their
  1212. projects.  Some encouragement always helps.  Look on your hard disk or in
  1213. the box of popular diskettes, you will know who I mean then.  If you really
  1214. want to drop me a note, there are various options.  For one thing, you can
  1215. send me E-mail over the Internet.  You can also send me a regular letter.
  1216. If you happen to have some 8-bit program disks for me, let me know, or send
  1217. me a note.  We are still collecting disks for the second Pooldisk CD.  The
  1218. first Pooldisk CD was a big success, and I would like to take this
  1219. opportunity to thank all the people that ordered one.  We hope to release
  1220. the second Pooldisk around October 1997, that is, if we can collect enough
  1221. new stuff.  Just as with the first CD, only shareware, freeware and Public
  1222. Domain stuff.  We have no intention of violating copyrights of anyone, even
  1223. if these rights are old, and the amount of damage to business is
  1224. negligable.  At this point, I am wondering whether there are shareware
  1225. cassettes at all.  If there are, this would be a great moment for
  1226. converting them to a .cas file, so we can include them on the CD.  Let me
  1227. know if you know of any.  Any librarians out there?  Anyway, if you have
  1228. questions, send them to me.  Please do not send me .wav files to look at.
  1229. It would be crazy to E-mail a file of several megabytes.  You are welcome
  1230. to send any comments.  If you think some of my data or research is in
  1231. error, let me know.  The address is below.
  1232.  
  1233. Ernest R. Schreurs.
  1234. Kempenlandstraat 8
  1235. 5211 VN  Den Bosch
  1236. The Netherlands
  1237. E-mail: ernest@pi.net
  1238.